qt4

Compile & build qt4 on ubuntu 12.04

五迷三道 提交于 2019-12-23 10:21:46
问题 I am trying to compile and build Qt 4.8.3 from source. When I do ./configure, I get the following error message : ./configure: 183: ./configure: /^(QMAKE_CXX)=/ { print substr($0, index($0, "=") + 1) }: not found ERROR: Cannot set the compiler for the configuration tests Is this happening because I need to explicitly set the QMAKE_CXX variable? Thanks 来源: https://stackoverflow.com/questions/13100276/compile-build-qt4-on-ubuntu-12-04

QDialog remove title bar

家住魔仙堡 提交于 2019-12-23 10:16:56
问题 The net is flooded with similar questions, but for all I have seen nothing suits to solve the problem at hand. In my QT-C++ app, I have a mainwindow form with some functions, there is a QPushButton, Pressing which a QDialog opens. Now, all functionalities in forms work fine, but I want the final application to be without any top title bar. i.e. No Close / Minimize / Maximize Button. In my main.cpp I have done -- int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w

How to prevent QSpinBox from automatically highlighting contents

南笙酒味 提交于 2019-12-23 09:33:54
问题 QSpinBox makes its contents selected (highlighted) upon using up/down buttons. Is there any way to disable this? Is there any way to clear selection, other than use my own subclass of QSpinBox to access the underlying QLineEdit ? 回答1: There's no way to directly disable it, but you can do a bit of a hack: void Window::onSpinBoxValueChanged() // slot { spinBox->findChild<QLineEdit*>()->deselect(); } I recommend connecting to this using a queued connection, like this: connect(spinBox, SIGNAL

Create Linux install for Qt application

二次信任 提交于 2019-12-23 09:28:10
问题 I just made a great program with Qt Creator. I'm very pleased with myself. How do I move it from my desktop to my laptop? So, the best way would be an installer right? And for Ubuntu, that's a debian package right? How do I do that? Has someone done this and could they share the template files for QT 4.5? Thanks, Mike 回答1: If you want to run the application foo you created on the machine desktop on another machine laptop , then simply copy the binary, for example via scp run ldd foo on laptop

How to work with OpenGL and QT?

筅森魡賤 提交于 2019-12-23 09:10:10
问题 I'm Working on a small project and i need to work with OpenGL + QT I'm Newbie in both of them. So i need a good tutorial that illustrates how to work with them each other not individually is it better to work OpenGL on QT Creator or use QT Visual Studio Plug-in? 回答1: You'll be using QGLWidget a lot! Here you go: http://doc.qt.io/qt-5/examples-widgets-opengl.html Of all those, maybe this is the best one to start: Hello GL Example. If you prefer using Qt Quick instead of Qt Widgets, check these

Adding a minimize button to a Qt dialog?

流过昼夜 提交于 2019-12-23 09:04:04
问题 I have created a QDialog based app using Qt Creator and all is well other than the dialog has no minimize button. How can I add one? Is there a property in the designer that I can set? 回答1: You can't add the minimize button yourself as it is handled by the window manager. You can tell the window manager how your dialog should be handled using Window Manager hints. This is done using the windowFlags property of your widget. There's also an example demonstrating this. setWindowFlags(windowFlags

Qt : what is the difference between layout and widget?

一世执手 提交于 2019-12-23 08:46:40
问题 I thought that layout is just a widget that keeps more widgets inside. But now I find that I can't add it to other widgets using addWidget. For instance how to add a layout to QSplitter? 回答1: QWidget has built in support for layouts through the layout() and setLayout(...) functions. The layout object controls the positioning of different child widgets that may be added to the layout. In addition, it makes sure to correctly size its parent widget based on the constraints specified. If the

Qt : what is the difference between layout and widget?

浪子不回头ぞ 提交于 2019-12-23 08:46:10
问题 I thought that layout is just a widget that keeps more widgets inside. But now I find that I can't add it to other widgets using addWidget. For instance how to add a layout to QSplitter? 回答1: QWidget has built in support for layouts through the layout() and setLayout(...) functions. The layout object controls the positioning of different child widgets that may be added to the layout. In addition, it makes sure to correctly size its parent widget based on the constraints specified. If the

Qt4: adjust which widget get focused on start

自闭症网瘾萝莉.ら 提交于 2019-12-23 07:58:13
问题 If I don't re-implement QMainWindow::showEvent() (which will contains a setFocus() method for that widget), is there any way to let some widget get focused first, when the window is loaded ? I use form editor of Qt4, but failed to find somewhere to configure that. 回答1: You can set the Tab Order in Qt Designer or the Designer component in Qt Creator. The first widget in the tab order should get focus on load. Many users expect to be able to navigate between widgets and controls using only the

Events with QGraphicsItemGroup

孤人 提交于 2019-12-23 07:37:06
问题 In my application I want to use QGraphicsItemGroup for grouping items into one item. I played with it a little and not sure using it because when I want to catch events, events are merged together but I want to handle specific event with specific child. How can I achieve this? 回答1: You need to call QGraphicsItemGroup::setHandlesChildEvents(false) . This stops the QGraphicsItemGroup trying to handle the event, and lets the child QGraphicsItem s handle them instead. 回答2: I think that's the