well, thanks, i was playing around with that for the last 4 hours, but i don't get it to work...
Maybe you could tell me whats wrong with this:
main.cpp
#include "mainwindow.h"
#include <QxtApplication>
int main(int argc, char *argv[])
{
QxtApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
#include "mainwindow.h"
#include <QxtApplication>
int main(int argc, char *argv[])
{
QxtApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
mainwindow.h
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QtGui/QMainWindow>
#include <QxtApplication>
#include <QxtGlobalShortcut>
namespace Ui
{
class MainWindow;
}
{
Q_OBJECT
QxtGlobalShortcut *m_action;
public:
~MainWindow();
public slots:
void jump();
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QtGui/QMainWindow>
#include <QxtApplication>
#include <QxtGlobalShortcut>
namespace Ui
{
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
QxtGlobalShortcut *m_action;
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
public slots:
void jump();
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
To copy to clipboard, switch view to plain text mode
and mainwindow.cpp
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QxtApplication>
#include <QxtGlobalShortcut>
#include <QDebug>
MainWindow
::MainWindow(QWidget *parent
){
ui->setupUi(this);
connect(m_action, SIGNAL(activated()), this, SLOT(jump()));
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::jump()
{
qDebug() << "Jump!";
}
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QxtApplication>
#include <QxtGlobalShortcut>
#include <QDebug>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindow), m_action(new QxtGlobalShortcut(QKeySequence("Ctrl+Alt+A")))
{
ui->setupUi(this);
connect(m_action, SIGNAL(activated()), this, SLOT(jump()));
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::jump()
{
qDebug() << "Jump!";
}
To copy to clipboard, switch view to plain text mode
The Problem is:
When i start the program (compiling works fine), the application closes, and windows tells me something like "....exe isn't working anymore..." [sorry, i don't know the exakt message in english, that's the translation of the german message]
Doe's anyone know what I did wrong?
(I'm using QtCreator..)
Bookmarks