Qtabwidget and webview trouble



  • Hey,
    So whenever I place a webview inside a tabwidget I get this error: error: [Makefile] Error 3.
    I am sure im missing something super simple.
    Thanks!



  • Look at compiler output, what written there?



  • error:[Makefile] Error 3



  • I gues it is info from Issues output panel
    in compiller output panel you can see more detail info

    !http://s23.postimg.org/nhk2kv8sb/untitled.png(img)!



  • Maybe you already tried that but clean and compile again. I usually do that when facing that kind of error



  • here is the output. I suck at making heads or tails of it.

    20:37:24: Running steps for project tabs...
    20:37:24: Configuration unchanged, skipping qmake step.
    20:37:24: Starting: "/usr/bin/make" -w
    make: Entering directory /home/nick/tabs-build-Desktop_Qt_5_0_1_GCC_32bit-Debug' /home/nick/Qt5.0.1/5.0.1/gcc/bin/qmake -spec linux-g++ CONFIG+=debug CONFIG+=declarative_debug CONFIG+=qml_debug -o Makefile ../tabs/tabs.pro Project ERROR: Unknown module(s) in QT: QWebWidgets make: Leaving directory/home/nick/tabs-build-Desktop_Qt_5_0_1_GCC_32bit-Debug'
    make: *** [Makefile] Error 3
    20:37:24: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project tabs (kit: Desktop Qt 5.0.1 GCC 32bit)
    When executing step 'Make'

    thanks!



  • Can you post your project file? Looks like you forgot to add webkit in the project. Code would be also nice.

    I use webbview in a QTabWidget and it works very well.



  • tabs.pro:
    @
    #-------------------------------------------------

    Project created by QtCreator 2013-06-12T16:58:35

    #-------------------------------------------------

    QT += core gui

    greaterThan(QT_MAJOR_VERSION, 4): QT += QWebWidgets

    TARGET = tabs
    TEMPLATE = app

    SOURCES += main.cpp
    mainwindow.cpp

    HEADERS += mainwindow.h

    FORMS += mainwindow.ui
    @

    mainwindow.h:
    @
    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H

    #include <QMainWindow>

    namespace Ui {
    class MainWindow;
    }

    class MainWindow : public QMainWindow
    {
    Q_OBJECT

    public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    private:
    Ui::MainWindow *ui;
    };

    #endif // MAINWINDOW_H
    @

    main.cpp:
    @
    #include "mainwindow.h"
    #include <QApplication>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    MainWindow w;
    w.show();

    return a.exec&#40;&#41;;
    

    }
    @

    mainwindow.cpp:
    @
    #include "mainwindow.h"
    #include "ui_mainwindow.h"

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);
    }

    MainWindow::~MainWindow()
    {
    delete ui;
    }
    @

    mainwindow.ui:
    @
    <?xml version="1.0" encoding="UTF-8"?>
    <ui version="4.0">
    <class>MainWindow</class>
    <widget class="QMainWindow" name="MainWindow">
    <property name="geometry">
    <rect>
    <x>0</x>
    <y>0</y>
    <width>657</width>
    <height>481</height>
    </rect>
    </property>
    <property name="windowTitle">
    <string>MainWindow</string>
    </property>
    <widget class="QWidget" name="centralWidget">
    <widget class="QTabWidget" name="tabWidget">
    <property name="geometry">
    <rect>
    <x>10</x>
    <y>50</y>
    <width>601</width>
    <height>371</height>
    </rect>
    </property>
    <property name="currentIndex">
    <number>0</number>
    </property>
    <widget class="QWidget" name="tab">
    <attribute name="title">
    <string>Tab 1</string>
    </attribute>
    <widget class="QWebView" name="webView">
    <property name="geometry">
    <rect>
    <x>9</x>
    <y>19</y>
    <width>361</width>
    <height>301</height>
    </rect>
    </property>
    <property name="url">
    <url>
    <string>about:blank</string>
    </url>
    </property>
    </widget>
    </widget>
    <widget class="QWidget" name="tab_2">
    <attribute name="title">
    <string>Tab 2</string>
    </attribute>
    </widget>
    </widget>
    </widget>
    <widget class="QMenuBar" name="menuBar">
    <property name="geometry">
    <rect>
    <x>0</x>
    <y>0</y>
    <width>657</width>
    <height>20</height>
    </rect>
    </property>
    </widget>
    <widget class="QToolBar" name="mainToolBar">
    <attribute name="toolBarArea">
    <enum>TopToolBarArea</enum>
    </attribute>
    <attribute name="toolBarBreak">
    <bool>false</bool>
    </attribute>
    </widget>
    <widget class="QStatusBar" name="statusBar"/>
    </widget>
    <layoutdefault spacing="6" margin="11"/>
    <customwidgets>
    <customwidget>
    <class>QWebView</class>
    <extends>QWidget</extends>
    <header>QtWebKitWidgets/QWebView</header>
    </customwidget>
    </customwidgets>
    <resources/>
    <connections/>
    </ui>
    @

    hopefully this helps! thanks!



  • @
    greaterThan(QT_MAJOR_VERSION, 4): QT += QWebWidgets
    @

    This line is wrong





  • ok whats wrong with it? I didn't touch it. how should it be?



  • anyone know?



  • never mind I just got it! thanks everybody for your help! I love this forum....



  • [Makefile] Error 3



  • yep, that what I got. I got past it though by changing some code in the .pro file.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.